package com.blrs.common.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 用途类型枚举
 */
public enum UseTypeEnum {
    
    PLANNING(1, "策划"),
    TEMPLATE(2, "模版"),
    IMPLEMENTATION(3, "实施");

    private final int code;
    private final String info;

    UseTypeEnum(int code, String info) {
        this.code = code;
        this.info = info;
    }

    public int getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    /**
     * 获取所有用途类型编码
     */
    public static List<Integer> getAllCodes() {
        List<Integer> codes = new ArrayList<>();
        for (UseTypeEnum type : UseTypeEnum.values()) {
            codes.add(type.getCode());
        }
        return codes;
    }

    /**
     * 根据code获取枚举值
     */
    public static UseTypeEnum getByCode(int code) {
        for (UseTypeEnum type : UseTypeEnum.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }
} 